// Created by WXX on 2022/1/20 14:01
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

class Solution {
public:
    bool stoneGameIX(vector<int>& stones) {
        int cnt[3] = {0};
        for (auto x : stones) cnt[x % 3]++;

        if (cnt[0] % 2 == 0) return cnt[1] && cnt[2];
        return abs(cnt[1] - cnt[2]) > 2;
    }
};

int main() {

    vector<int> stones = {2, 1};
    cout << Solution().stoneGameIX(stones) << endl;  // true

    return 0;
}
